#include <iostream>
#include "Vector2D.hpp"

int main()
{
  const float Pi = 3.141592654f;

  Vector2D vect1(1, 2);
  Vector2D vect2 = vect1.normal(); // vect2 is the normal of vect1

  Vector2D vect3(1, 0);
  Vector2D vect4(1, -1);

  // Testing addition, substraction and dot product of two vectors.
  std::cout << vect1 << " + " << vect2 << " = " << vect1 + vect2 << std::endl;
  std::cout << vect1 << " - " << vect2 << " = " << vect1 - vect2 << std::endl;
  std::cout << vect1 << " . " << vect2 << " = " << vect1 * vect2 << std::endl;

  std::cout << std::endl;

  // Testing Magnitude and normalization...
  std::cout << "Magnitude of " << vect1 << " = " <<
               vect1.getMagnitude() << std::endl;
  std::cout << "Normalized vector of " << vect1 << " = " <<
               vect1.unit() << std::endl;
  std::cout << std::endl;

  // Testing scalar multiplication...
  std::cout << "5" << vect1 << " = " << vect1 * 5 << std::endl;
  std::cout << "7" << vect2 << " = " << 7 * vect2 << std::endl;
  std::cout << std::endl;

  // Testing angle calculation
  std::cout << "The angle between vect1 & vect2 is ";
  std::cout << (vect1.getAngle(vect2) / Pi) * 180.f << " degrees" << std::endl;

  std::cout << "The angle between vect3 & vect4 is ";
  std::cout << (vect3.getAngle(vect4) / Pi) * 180.f << " degrees" << std::endl;
  std::cout << std::endl;

  std::cin.get();
  return 0;
}
